from openerp import models, fields, api

class purchase_apply_status(models.Model):

    _name = 'purchase.apply'

    _inherit = ['purchase.apply','mail.thread','ir.needaction_mixin']
    _description = 'Purchase Apply'
    _track = {
        'state': {
            'purchase_apply.mt_purchase_setting': lambda self, cr, uid, obj, ctx=None: obj.state == 'draft',
            'purchase_apply.mt_purchase_confirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'confirmed',
            'purchase_apply.mt_purchase_storeconfirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'storeconfirmed',
            'purchase_apply.mt_purchase_waitconfirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'waitconfirmed',
            'purchase_apply.mt_purchase_departmentconfirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'departmentconfirmed',
            'purchase_apply.mt_purchase_purchaseconfirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'purchaseconfirmed',
            'purchase_apply.mt_purchase_financialconfirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'financialconfirmed',
            'purchase_apply.mt_purchase_managerconfirmed': lambda self, cr, uid, obj, ctx=None: obj.state == 'managerconfirmed',
        },
    }